Getting help

Contents|Index|Previous|Next
Getting help

You can always ask GDB itself for information on its commands, using the command, help. The following documentation can also serve as a guide to information that can help.

help
h
You can use help (abbreviated ‘h’) with no arguments to display a short list of named classes of commands like the following example output.

`(gdb) help` `List of classes of commands:`
`running -- Running the program`
`stack -- Examining the stack`
`data -- Examining data`
`breakpoints -- Making program stop at certain points`
`files -- Specifying and examining files`
`status -- Status inquiries`
`support -- Support facilities`
`user-defined -- User-defined commands`
`aliases -- Aliases of other commands`
`obscure -- Obscure features`
`Type "help" followed by a class name for a list of commands`
`in that class. Type "help" followed by command name for full`
`documentation. Command name abbreviations are allowed if`
`unambiguous.`
`(gdb)`

help class
Using one of the general help classes as an argument, you can get a list of the individual commands in that class. For example, here is the help display for the class, status:

`(gdb) help status Status inquiries.`
`List of commands:`
``
`show -- Generic command for showing things set with "set"`
`info -- Generic command for printing status`
``
`Type "help" followed by command name for full documentation.`
`Command name abbreviations are allowed if unambiguous.`
``
`(gdb)`

help command

With a command name as help argument, GDB displays a short paragraph on how to use that command.

complete args

The complete args command lists all the possible completions for the beginning of a command. Use args to specify the beginning of the command you want completed. For example: complete i results in the following.

info
inspect
ignore

This command is intentionally for use by GNU Emacs.
In addition to help, you can use the GDB commands info and show to inquire about the state of your program, or the state of GDB itself. Each command supports many topics of inquiry; this documentation introduces each of them in the appropriate context.
For info, see Your program’s input and output, Additional process information, Debugging programs with multiple threads, Setting breakpoints, Setting watchpoints, Information about a frame, Source and machine code, Automatic display, Registers, Displaying the language, C and C++, Examining the symbol table, Commands to specify files, and Errors reading symbol files.
For show , see Your program’s arguments, Your program’s environment, MIPS machines and the function stack, Printing source lines, Print settings, Value history, Convenience variables, Registers, Displaying the language, An overview of type checking, An overview of range checking, C and C++, Patching programs, Commands for managing targets, GDB and remote MIPS boards, Command editing, Command history, Screen size, Numbers, Optional warnings and messages, and User defined commands.

info

This command (abbreviated i) is for describing the state of your program. For example, you can list the arguments given to your program with info args, list the registers currently in use with info registers, or list the breakpoints you have set with info breakpoints. For info, see Your program’s input and output, Additional process information, Debugging programs with multiple threads, Setting breakpoints, Setting watchpoints, Information about a frame, Source and machine code, Automatic display, Registers, Displaying the language, C and C++, Examining the symbol table, Commands to specify files, and Errors reading symbol files. You can get a complete list of the info subcommands with help info.

set

You can assign the result of an expresson to an environment variable with set. For example, you can set the GDB prompt to a $-sign with set prompt $.

show

In contrast to info, show is for describing the state of GDB itself. You can change most of the things you can show, by using the related command, set; for example, you can control what number system is used for displays with set radix,or simply inquire which is currently in use with show radix.
To display all the settable parameters and their current values, you can use show with no arguments; you may also use info set. Both commands produce the same display.
For show , see Your program’s arguments, Your program’s environment, MIPS machines and the function stack, Printing source lines, Print settings, Value history, Convenience variables, Registers, Displaying the language, An overview of type checking, An overview of range checking, C and C++, Patching programs, Commands for managing targets, GDB and remote MIPS boards, Command editing, Command history, Screen size, Numbers, Optional warnings and messages, and User defined commands.
The following are three miscellaneous show subcommands, all of which are exceptional in lacking corresponding set commands.

- show version

Show what version of GDB is running. You should include this information in GDB bug reports. If multiple versions of GDB are in use at your site, you may occasionally want to determine which version of GDB you are running; as GDB evolves, new commands are introduced, and old ones may wither away. The version number is also announced when you start GDB.

- show copying

Display information about permission for copying GDB.

- show warranty

Display the GNU “NO WARRANTY” statement (see About GDB... menu item for Cygnus Insight's Source Window’s Help menu in Working with Cygnus Insight, the visual debugger.

Top|Contents|Index|Previous|Next